package designmode.absfactory;

public class LDFactory implements AbsFactory {
    Pizza pizza;
    String orderType;
    public LDFactory(String orderType){
        this.orderType=orderType;
    }
    @Override
    public Pizza createPizza() {
        if ("LDCheessPizza".equals(orderType)){
            pizza=new LDCheessPizza();
        }else if ("LDPepperPizza".equals(orderType)){
            pizza=new LDPepperPizza();
        }
        if (null!=pizza){
            pizza.prepare();
            pizza.bake();
            pizza.cut();
            pizza.box();
        }
        return pizza;
    }
}
